#include "base/callback.h"

/*
Callback::Callback() {
}

Callback::~Callback() {
}
  
bool Callback::delete_self() {
  return delete_self_;
}
  
void Callback::set_delete_self(bool delete_self) {
  delete_self_ = delete_self;
}

Callback0::Callback0(void (*fun)()) {
  fun_ = fun;
}
  
void Callback0::Run() {
  (*fun_)();
  if (delete_self()) {
    delete this;
  }
}

Callback* NewCallback(void (*fun)()) {
  return new Callback0(fun);
}

Callback* NewPermanentCallback(void (*fun)()) {
  Callback* r = new Callback0(fun);
  r->set_delete_self(false);
  return r;
}

*/
